An Efficient Hash-Selection-Based Blockchain …

249

A simple processor benchmarking algorithm is being used to get a measure of

the computational power of the IIoT devices being used, which in turn is used to

generate the device token. This token is used for two specific purposes. Firstly, the

device token contains tier data from the benchmarking algorithm which the block

generation process uses to dynamically select the best fit for the hashing algorithm

for the device’s computational capacity. Next, this measure is also used to separate

the various devices in the IIoT network into clusters each having devices of similar

computational power.

There are many common ways to benchmark the processing power of a processor,

such as finding a large number of prime integers, manipulating matrices of very large

dimensions, and calculating factorials of large numbers. All of these approaches had

one major issue. When the target value is set high, the required amount of time

for the benchmark process to complete on devices with low power processors, like

Raspberry Pi systems, becomes so high that it becomes unfeasible. When the target

value is set low enough for low power devices to complete the process within feasible

time, the result obtained from the benchmark algorithm became wildly inconsistent

for the devices with higher power.

To solve these issues, we have chosen to create a new benchmarking algorithm, by

iterating a number of complex trigonometric functions in fixed time. This time, Tend

would remain fixed for all possible devices, so the number of iterations completed

in this fixed time would vary positively with the computational power of the device

concerned. This whole process is repeated R number of times and the mean number

of completed iterations is used to gauge the computational power of the processor

of the device. This mean is now used to generate the device-specific token, and this

is depicted in the flowchart of Fig. 4.

The complex functions we have opted for are the following trigonometric func-

tions: sine, cosine, tangent, and their inverse functions. All of these functions are rela-

tively complex, having the same computational complexity O(M(n)log(n)), where

M(n) being the cost of multiplication and n being the number of bits accuracy. Theo-

retically, the complexity of M(n) itself is O(nlog2(n) log log(n)) by Fourier’s algo-

rithm [46, 47]. There are a total of nine instances of these in the algorithm, executed

over the full 360° range. For every reiteration N before the timer T reaches Tend, the

total number of times the mathematical loop is repeated increases also by arithmetic

progression by j which iterates from 1 to N. This ensures that for low power devices

the total number of mathematical calculations remains low while increasing signif-

icantly for the higher power devices so that the end result is sufficiently consistent

even if Tend is set to be quite low.